require('./PageHome.styl');
const classNames = require("classnames")
const reactMixin = require('react-mixin');
const Actions = require('./actions');
const Store = require('./store');
import { Control } from 'react-keeper';
import { Boxs, NavBar } from 'saltui';
import ui from 'clientConfig/util/jsapi/ui';
const { HBox, Box, VBox } = Boxs;
const WithRefresh = require('components/withrefresh');
const PendingList = require('components/pendinglist');
import { ready } from 'clientConfig/util/queryurlfield'
const ListWithSelection = WithRefresh(
    PendingList,
    (pageNum, props, success, error) => {
        Actions.fetch(pageNum, props, success, error)
    }
);
class Home extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            listdata: [],//班级列表
            classId: '',
            title: '',
            isMarker: false
        };
        this.handleOnLeftClick = this.handleOnLeftClick.bind(this)
        this.handleOnRightClick = this.handleOnRightClick.bind(this);
    }
    handleOnLeftClick() {
        ui.close();
    }
    //右侧导航按钮
    handleOnRightClick() {
        Control.go('/home/addgrade/new');
    }
    render() {
        let t = this;
        return (
            <div className="home">
                <NavBar
                    className={classNames({ "ios-nav-bar": window.isIphone })}
                    isShow={false}
                    title='选课'
                    onLeftClick={this.handleOnLeftClick.bind(this)}
                    onRightClick={this.handleOnRightClick.bind(this)}
                    rightText=''
                />
                <ListWithSelection
                    className="msg"
                    ref="ListWithSelection"
                    leftSlip={false}
                />
            </div>
        );
    }

    componentWillMount() {
    }

    componentDidMount() {
    }

    componentWillReceiveProps(nextProps) {
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {

    }
}
reactMixin.onClass(Home, Reflux.connect(Store));
module.exports = Home;
